<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport"
	content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<title>今日早餐</title>
<link href="css/style2zc.css" rel="stylesheet" type="text/css">
<link href="css/type.css" rel="stylesheet" type="text/css">
<style type="text/css">
/*<![CDATA[*/
* html .decoration {
	position: absolute;
	right: 16px;
	top: 0;
} /*only for ie*/
/*]]>*/

img.arrow-down {
	width: 0.75rem;
	height: 0.4375rem;
	-moz-transform:rotate(-90deg);
	-webkit-transform:rotate(-90deg);
	filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);   
}
</style>
<!-- Do not move the bellow script to custom.js! It must stay here to
    load properly! -->
<script type="text/javascript" src="scripts/jquery.js"></script>
<script type="text/javascript" src="scripts/jquerysession.js"></script>
<script type="text/javascript" src="scripts/custom2zc.js" charset="utf-8"></script>
<script type="text/javascript" src="scripts/layer/layer.m.js"></script>
</head>
<body onLoad="loadImages()">
	<p class="no-mobile">
		请使用手机访问本页面！ <br /> 这个页面是专门针对手机设计的！
	</p>
	<div class="site">
		<div id="hidepage">
			<p class="center-text">
				正在努力加载中，请耐心等待! <br /> <img src="images/background/130.gif"
					alt="load">
			</p>
		</div>
		
		<div class="decoration">
				<div class="back">
					<a href="index2zc.jsp??toPage=0">
					<!-- <a href="javascript:history.back(-1)"> -->
						<img src="images/home/back.png">
					</a>
				</div> 
				<p class="title" style="width: 33%;float: left;">今日早餐</p>
				<div  style="width: 33%;float:right;">
					<c:if test="${nowWeek==0}">
						<c:if test="${sendWeek==0}">
							<a id="choiceWeek" href="transaction2zcRouter?funcID=0011&landmarkId=${param.landmarkId}&sendWeek=1">
								<img style="width:60px;height:30px;float:right;margin-top: 5px;margin-right: 10px" src="images/home/nextWeek.png">
							</a>
						</c:if>
						<c:if test="${sendWeek==1}">
							<%-- <a id="choiceWeek" href="transaction2zcRouter?funcID=0011&landmarkId=${param.landmarkId}&sendWeek=0">
							本周 
							</a> --%>
							<a id="choiceWeek" href="transaction2zcRouter?funcID=0011&landmarkId=${param.landmarkId}&sendWeek=0">
								<img style="width:60px;height:30px;float:right;margin-top: 5px;margin-right: 10px" src="images/home/currentWeek.png">
							</a>
						</c:if>
					</c:if> 
					
				</div> 
		</div>
		
		
		<c:if test="${requestScope.list.size()>0}">
		<div class="fixed_buy_lag">
			<!-- <a href="web2zc/order/order.html">
				<img src="images/home/buy_lag.png">
			</a> -->
			<a href="javascript:void(0)" onclick="postJsondata()">
				<img src="images/home/next_lag.png">
			</a>
		</div> 
		<div id="wrapper">
			<input type="hidden" id="areaId" value="${param.landmarkId}">
			<div class="zcs" style="height: 100%;">
			<c:forEach var="e" items="${requestScope.list}" varStatus="status">
				<div class="zcItem" zcid="${e.id}" sell="${e.sell}" style="margin-top:2%;">
					<div class="zcImgDiv" >
						<a id="zcDetailUrl" href="/jrzc/${e.id}.html">
						<img id=zcItemImg src="images/home/home_${e.week}.png">
						</a>
					</div>
					<div class="zcContentdiv" >
						<div class="zcDescribe">
							<div class="zcName"><p id="pzcName">${e.name}</p></div>
							<div class="zcPrice"><p>￥<font id="pzcPrice">${e.price}</font></p></div> 
						</div>
						<c:choose>
							<c:when test="${e.sell}">
								<div class="numberdiv" >
									<div class="jian" onmousedown="jian(this)"></div>
									<div class="shuzi"><p class="cpInfo" price="${e.price}" id="zcCount">1</p></div>
									<div class="jia" onmousedown="jia(this)"></div>
								</div>
								
								<div class="show-more" style="float: right;margin-right: 3%">
							    	<span id="expand-all" switchWeek="${e.week-1}" onmousedown="zcSwitch(this)">
							    		<img class="arrow-down" src="img/arrow-down-red.png" alt="">
							    	</span>
			      				</div>	
								
							</c:when>
							<c:otherwise>
								<div class="numberdiv"  style="width: 100%;">
									<p style="color: red">日期已过,无法预订</p>
								</div>
							</c:otherwise>
						</c:choose>	
					</div>
					<div id="week" class="week${e.week}" week="${e.week}">
							 <div class="dataNum">${e.sellTime}</div>
					</div>	
					<div class="line"><img src="images/home/line_03.png"></div>
					<div style="clear:both"></div>	
				</div>
			</c:forEach>
			<div class="total" style="text-align: center;">
				<p>共<font id="cnumber" color="#ff6c0d">${itemSize}</font>件&nbsp;&nbsp;共<font id="cprice" color="#ff6c0d">${total}</font>元</p>
			</div>
		</div>
		</div>
		</c:if>
		<c:if test="${requestScope.list.size()<=0}">
			<div class="zcImgDiv"  style="width: 60%;margin-left: 20%;margin-right: 20%;margin-top: 30%" >
				<img  src="images/order/no_order_03.png">
				<div style="text-align: center;margin-top: 10%">
					<font color="#323232">没有相关早餐数据</font>
				</div>
			</div>
			
		</c:if> 
	</div>
	
	<form action="transaction2zcRouter?funcID=0012" method="post" id="zcItemFrom">
		<input type="hidden" id="orderJson" name="orderJson">
	</form>
	<script type="text/javascript">
		var zcItemlist=${requestScope.listJson};
		function zcSwitch(obj){
			var zcItemDiv=$(obj).parent().parent().parent();
			
			var switchWeek=($(obj).attr("switchWeek")-0)+1;
			if(switchWeek>4){
				switchWeek=0
			}
			var zcItem=zcItemlist[switchWeek];
			var zcItemWeek=zcItem.week;
			var zcItemName=zcItem.name;
			var zcItemprice=zcItem.price;
			//var zcItemSize=zcItemDiv.find("p[id=zcCount]").html();
			$(obj).attr("switchWeek",switchWeek);
			zcDetailUrl
			zcItemDiv.find("a[id=zcDetailUrl]").attr("href","/jrzc/"+zcItemWeek+".html");
			zcItemDiv.find("img[id=zcItemImg]").attr("src","images/home/home_"+zcItemWeek+".png");
			zcItemDiv.find("p[id=pzcName]").html(zcItemName);
			zcItemDiv.find("font[id=pzcPrice]").html(zcItemprice);
			zcItemDiv.find("p[id=zcCount]").attr("price",zcItemprice);
			var size=0,total=0;
			$.each($(".cpInfo"),function(){
				var count=$(this).html()-0;
				var price=$(this).attr("price")-0;
				size+=count;
				total+=count*price;
			});
			$("#cnumber").html(size);
			$("#cprice").html(total);
		}
	</script>
</body>
</html>